﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharedGenomics.Core
{
    public class LogEntry
    {
        public LogEntry(string message)
            : this(null, message, MessagePriority.Information)
        {
        }

        public LogEntry(string message, MessagePriority priority)
            : this(null, message, priority)
        {
        }

        public LogEntry(Exception ex)
            : this(ex, ex.Message, MessagePriority.Error)
        {
        }

        public LogEntry(Exception ex, string message)
            : this(ex, message, MessagePriority.Error)
        {
        }

        public LogEntry(Exception ex, string message, MessagePriority priority)
        {
            message.ThrowIfNull("message");

            this.Exception = ex;
            this.Message = message;
            this.Priority = priority;
        }

        public string Message { get; private set; }
        public Exception Exception { get; private set; }
        public bool ThrowOnLogFailure { get; set; }
        public MessagePriority Priority { get; set; }
        public Type LogType { get; set; }
    }
}
